import request from '@/utils/request'

// 查询收藏列表
export function listCollection(query) {
  return request({
    url: '/member/collection/list',
    method: 'get',
    params: query
  })
}

// 查询收藏详细
export function getCollection(collectionId) {
  return request({
    url: '/member/collection/' + collectionId,
    method: 'get'
  })
}

// 新增收藏
export function addCollection(data) {
  return request({
    url: '/member/collection',
    method: 'post',
    data: data
  })
}

// 删除收藏
export function delCollection(collectionId) {
  return request({
    url: '/member/collection/' + collectionId,
    method: 'delete'
  })
}

// 检查是否已收藏
export function checkCollection(memberId, movieId) {
  return request({
    url: `/member/collection/check/${memberId}/${movieId}`,
    method: 'get'
  })
}

// 导出收藏
export function exportCollection(query) {
  return request({
    url: '/member/collection/export',
    method: 'get',
    params: query
  })
}